import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/view/Home'
import Login from '@/view/Login'
import Register from '@/view/Register'
import Find from '../view/Find'
import Chat from '@/components/Chat'
import User from '@/components/User'
import Moment from '@/components/Moment'
import Microphone from '@/components/Microphone'
import Editor from '@/components/Editor'
import Emoji from '@/components/Emoji'
import Background from '@/components/Background'
import MomentDetail from '@/components/MomentDetail'
import MomentPublish from '../components/MomentPublish'
import MomentMain from '../components/MomentMain'
import CommentInput from '../components/CommentInput'

Vue.use(Router)

const router = new Router({
  // mode: 'history',
  routes: [
    {
      path: '/home',
      name: 'Home',
      component: Home,
      children: [
        {
          path: '/home/chat',
          name: 'Chat',
          component: Chat
        },
        {
          path: '/home/user',
          name: 'User',
          component: User
        },
        {
          path: '/home/moment',
          name: 'Moment',
          component: Moment,
          children: [
            {
              path: '/home/moment/publish',
              name: 'MomentPublish',
              component: MomentPublish
            },
            {
              path: '/home/moment/main',
              name: 'MomentMain',
              component: MomentMain
            },
            {
              path: '/home/moment/detail',
              name: 'MomentDetail',
              component: MomentDetail
            }
          ]
        },
        {
          path: '/home/face',
          name: 'Face',
          component: Microphone
        },
        {
          path: '/home/editor',
          name: 'Editor',
          component: Editor
        },
        {
          path: '/home/emoji',
          name: 'Emoji',
          component: Emoji
        },
        {
          path: '/home/background',
          name: 'Background',
          component: Background
        },
        {
          path: '/home/audio',
          name: 'Audio',
          component: CommentInput
        }
      ]
    },
    {
      path: '/',
      name: 'Login',
      component: Login
    },
    {
      path: '/register',
      name: 'Register',
      component: Register
    },
    {
      path: '/find',
      name: 'Find',
      component: Find
    },
    {
      path: '/editor',
      name: 'Editor',
      component: Editor
    }
  ]
})

export default router
